﻿@model BBICMS.Model.ViewModel.Back.EmailSetVM
@{
    ViewBag.Title = "邮箱服务设置";
    ViewBag.PageTitle = ViewBag.Title + "_常规设置";
}



@using (Ajax.BeginForm("EmailSet", null, new AjaxOptions()
            {
                OnSuccess = "updateSuccess",
                OnBegin = "onBegin",
                OnComplete = "onComplete"

            }, new { @class = "form-horizontal", role = "form" }))
            {
    <div class="panel panel-default">
        <div class="panel-heading">
           <span class="glyphicon glyphicon-envelope"></span> @ViewBag.Title
        </div>
        <div class="panel-body">


                @Html.AntiForgeryToken()
                @Html.ValidationSummary(false)


                <div class="form-group">
                    @Html.LabelFor(model => model.From, new { @class = "col-md-2 control-label" })
                    <div class="col-md-5">
                        @Html.TextBoxFor(model => model.From, new { @class = "form-control", placeholder = "电子邮箱" })
                    </div>
                    <div class="col-md-5">
                        @Html.ValidationMessageFor(model => model.From)
                    </div>
                </div>

                <div class="form-group">
                    @Html.LabelFor(model => model.SmtpServer, new { @class = "col-md-2 control-label" })
                    <div class="col-md-5">
                        @Html.TextBoxFor(model => model.SmtpServer, new { @class = "form-control", placeholder = "SMTP服务器" })
                    </div>
                    <div class="col-md-5">
                        @Html.ValidationMessageFor(model => model.SmtpServer)
                    </div>
                </div>

                <div class="form-group">
                    @Html.LabelFor(model => model.Port, new { @class = "col-md-2 control-label" })
                    <div class="col-md-5">
                        @Html.TextBoxFor(model => model.Port, new { @class = "form-control", placeholder = "端口" })
                    </div>
                    <div class="col-md-5">
                        @Html.ValidationMessageFor(model => model.Port)
                    </div>
                </div>

                <div class="form-group">
                    @Html.LabelFor(model => model.UserName, new { @class = "col-md-2 control-label" })
                    <div class="col-md-5">
                        @Html.TextBoxFor(model => model.UserName, new { @class = "form-control", placeholder = "用户名" })
                    </div>
                    <div class="col-md-5">
                        @Html.ValidationMessageFor(model => model.UserName)
                    </div>
                </div>


                <div class="form-group">
                    @Html.LabelFor(model => model.Password, new { @class = "col-md-2 control-label" })
                    <div class="col-md-5">
                        @Html.PasswordFor(model => model.Password, new { @class = "form-control", placeholder = "密码" })
                    </div>
                    <div class="col-md-5">
                        @Html.ValidationMessageFor(model => model.Password)
                    </div>
                </div>

                <div class="form-group">
                    @Html.LabelFor(model => model.EnableSsl, new { @class = "col-md-2 control-label" })
                    <div class="col-md-5">
                        <div class="checkbox">
                            <label>
                                @Html.EditorFor(model => model.EnableSsl)
                            </label>
                        </div>
                        @Html.ValidationMessageFor(model => model.EnableSsl)                  
                    </div>              
                </div>
                       
        </div>
        <footer class="panel-footer text-right">
            <input type="submit" class="btn btn-primary" value="保存资料" />
        </footer>
    </div>

}

<!-- loading -->
<div class="loading" id="divLoading">
    <div>
        <div class="c1"></div>
        <div class="c2"></div>
        <div class="c3"></div>
        <div class="c4"></div>
    </div>
</div>



@section footer {

   @Scripts.Render("~/bundles/jqueryvalWithBootstrap")
    <script>
        function onBegin() {
            $("#divLoading").show();
        }
        function onComplete() {
            $("#divLoading").hide();
        }


        function updateSuccess(data) {
            //  console.log(data.Oicq);
          Common.ShowBox(data.Status, data.Message, "@ViewBag.Title");
        }



        $(function () {
            Common.ActiveCurrentNav();
        });
    </script>

}
